using System;
using System.Linq.Expressions;
using PropertyExpression.Common;
using PropertyExpression.ControllableQuery.TypedReader;

namespace PropertyExpression.ControllableQuery.Test.Queries
{
    public static class PublicationInfoDataReaderExtensions
    {
        private static readonly Expression<Func<IPublicationInfo, Guid>> publicationId = _ => _.PublicationId;
        public static Guid PublicationId(this IDataReader<IPublicationInfo> it)
        {
            return it.GetValue(publicationId);
        }

        private static readonly Expression<Func<IPublicationInfo, NVarChar<L25>>> code = _ => _.Code;
        public static NVarChar<L25> Code(this IDataReader<IPublicationInfo> it)
        {
            return it.GetValue(code);
        }

        private static readonly Expression<Func<IPublicationInfo, Guid>> publicationTypeId = _ => _.PublicationTypeId;
        public static Guid PublicationTypeId(this IDataReader<IPublicationInfo> it)
        {
            return it.GetValue(publicationTypeId);
        }

        private static readonly Expression<Func<IPublicationInfo, IOption<Guid>>> followingPublicationId = _ => _.FollowingPublicationId;
        public static IOption<Guid> FollowingPublicationId(this IDataReader<IPublicationInfo> it)
        {
            return it.GetValue(followingPublicationId);
        }
    }
}

namespace PropertyExpression.ControllableQuery.Test.Queries.StringBuilding
{
    public static class PublicationTypeInfoDataReaderExtensions
    {
        private static readonly Expression<Func<IPublicationTypeInfo, Guid>> publicationTypeId = _ => _.PublicationTypeId;
        public static Guid PublicationTypeId(this IDataReader<IPublicationTypeInfo> it)
        {
            return it.GetValue(publicationTypeId);
        }

        private static readonly Expression<Func<IPublicationTypeInfo, int>> code = _ => _.Code;
        public static int Code(this IDataReader<IPublicationTypeInfo> it)
        {
            return it.GetValue(code);
        }

        private static readonly Expression<Func<IPublicationTypeInfo, IOption<NVarChar<L4000>>>> description = _ => _.Description;
        public static IOption<NVarChar<L4000>> Description(this IDataReader<IPublicationTypeInfo> it)
        {
            return it.GetValue(description);
        }

        private static readonly Expression<Func<IPublicationTypeInfo, Decimal<P18, S7>>> decimal1 = _ => _.Decimal1;
        public static Decimal<P18, S7> Decimal1(this IDataReader<IPublicationTypeInfo> it)
        {
            return it.GetValue(decimal1);
        }

        private static readonly Expression<Func<IPublicationTypeInfo, Money>> money1 = _ => _.Money1;
        public static Money Money1(this IDataReader<IPublicationTypeInfo> it)
        {
            return it.GetValue(money1);
        }

    }
}

namespace PropertyExpression.ControllableQuery.Test.Queries
{
    public static class ModelPublicationInfoDataReaderExtensions
    {
        private static readonly Expression<Func<IModelPublicationInfo, Guid>> publicationId = _ => _.PublicationId;
        public static Guid PublicationId(this IDataReader<IModelPublicationInfo> it)
        {
            return it.GetValue(publicationId);
        }

        private static readonly Expression<Func<IModelPublicationInfo, NVarChar<L4000>>> modelCode = _ => _.ModelCode;
        public static NVarChar<L4000> ModelCode(this IDataReader<IModelPublicationInfo> it)
        {
            return it.GetValue(modelCode);
        }

        private static readonly Expression<Func<IModelPublicationInfo, NVarChar<L4000>>> modelSequence = _ => _.ModelSequence;
        public static NVarChar<L4000> ModelSequence(this IDataReader<IModelPublicationInfo> it)
        {
            return it.GetValue(modelSequence);
        }

    }
}

namespace PropertyExpression.ControllableQuery.Test.Queries.T4
{
    public static class PartLinkInfoDataReaderExtensions
    {
        private static readonly Expression<Func<IPartLinkInfo, IOption<NVarChar<L15>>>> partNumber = _ => _.PartNumber;
        public static IOption<NVarChar<L15>> PartNumber(this IDataReader<IPartLinkInfo> it)
        {
            return it.GetValue(partNumber);
        }

    }
}

namespace PropertyExpression.ControllableQuery.Test
{
    public static class ModelPublicationInfoDataReaderExtensions
    {
        private static readonly Expression<Func<ModelPublicationInfo3, Guid>> publicationId = _ => _.PublicationId;
        public static Guid PublicationId(this IDataReader<ModelPublicationInfo3> it)
        {
            return it.GetValue(publicationId);
        }

        private static readonly Expression<Func<ModelPublicationInfo3, NVarChar<L4000>>> modelCode = _ => _.ModelCode;
        public static NVarChar<L4000> ModelCode(this IDataReader<ModelPublicationInfo3> it)
        {
            return it.GetValue(modelCode);
        }

        private static readonly Expression<Func<ModelPublicationInfo3, NVarChar<L4000>>> modelSequence = _ => _.ModelSequence;
        public static NVarChar<L4000> ModelSequence(this IDataReader<ModelPublicationInfo3> it)
        {
            return it.GetValue(modelSequence);
        }
    }
}
